#  CMakefiles.txt
cmake_minimum_required(VERSION 3.16.3)
project(prodemo)

# include(${CMAKE_SOURCE_DIR}/cmake/hi3403.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/cmakebase.cmake)

SET(PlatForm Linux)

if (PlatForm STREQUAL "hi3403")
    message("PlatForm  = hi3403")
    include(${CMAKE_SOURCE_DIR}/cmake/hi3403.cmake)
    
elseif (PlatForm STREQUAL "Linux")
    message("PlatForm  = Linux")
endif()

INCLUDE_DIRECTORIES(
    ${CMAKE_SOURCE_DIR}/src
    ${CMAKE_SOURCE_DIR}/src/hello
    ${CMAKE_SOURCE_DIR}/src/world
    ${CMAKE_SOURCE_DIR}/src/test_curl
    ${CMAKE_SOURCE_DIR}/src/utils
    ${CMAKE_SOURCE_DIR}/thirdparts
    # ${CMAKE_SOURCE_DIR}/thirdparts/pplog
    ${CMAKE_SOURCE_DIR}/thirdparts/curl
    ${CMAKE_SOURCE_DIR}/thirdparts/json
    ${CMAKE_SOURCE_DIR}/thirdparts/sqlite3
    ${CMAKE_SOURCE_DIR}/thirdparts/stb
) 

### 子项目编译动态库
add_subdirectory(src)
# add_subdirectory(thirdparts/pplog)
# add_subdirectory(thirdparts/json)
# add_subdirectory(thirdparts/mongoose)

set(src_list ${CMAKE_SOURCE_DIR}/src/*)


SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/output)

### 动态库目录
# LINK_DIRECTORIES(libs)
LINK_DIRECTORIES(libs/${PlatForm})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output/${PlatForm})


aux_source_directory(${PROJECT_SOURCE_DIR}/src/utils opensourceSrc)
# aux_source_directory(src/world opensourceSrc)
add_executable(${PROJECT_NAME} main.cpp ${opensourceSrc} )

### 添加头文件目录
# target_include_directories(${PROJECT_NAME}  PUBLIC world)

# ### 动态库链接文件
# target_link_libraries(${PROJECT_NAME}  PUBLIC hellolib)
# target_link_libraries(${PROJECT_NAME}  PUBLIC worldlib)
target_link_libraries(${PROJECT_NAME}  PUBLIC ${SET_LINK_LIB} ${SYSTEM_LINK_LIB} )
